import 'package:demo_app_video/page/home_main.dart';
import 'package:demo_app_video/page/login.dart';
import 'package:demo_app_video/page/not_fund.dart';
import 'package:demo_app_video/page/search/search.dart';
import 'package:demo_app_video/page/search_details/search_details.dart';
import 'package:fluro/fluro.dart';

class RouterHandler {
  // 根路径
  static var rootHandler = Handler(handlerFunc: (context, params) {
    return HomeMainPage();
  });

// 页面不存在
  static var notFoundHandler = Handler(handlerFunc: (context, params) {
    return NotFoundPage();
  });

// 设置页面  不带参数
  static var searchHandler = Handler(handlerFunc: (context, params) {
    return SearchPage();
  });

  // 设置页面  不带参数
  static var loginHandler = Handler(handlerFunc: (context, params) {
    return LoginPage();
  });

  static var searchDetailsHandler = Handler(handlerFunc: (context, params) {
    return SearchDetailsPage();
  });

  // 网页加载带参数 -示例：传多个字符串参数
  static var webViewHandler = Handler(handlerFunc: (context, params) {
    // params 内容为 {title: [我是标题哈哈哈],url: [https://www.baidu.com]}
    String? titleStr = params['title']?.first;
    String? urlStr = params['url']?.first;
    // return WebViewPage(title: "$titleStr", url: "$urlStr");
  });
}
